package com.stylefeng.guns.modular.system.service;

import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.plugins.pagination.Pagination;
import com.baomidou.mybatisplus.service.IService;
import com.stylefeng.guns.common.persistence.model.TBill;
import com.stylefeng.guns.common.persistence.model.TOrder;
import com.stylefeng.guns.common.persistence.model.TTrain;

import java.util.List;
import java.util.Map;

/**
 * <p>
 *  服务类
 * </p>
 *
 * @author xiejie123
 * @since 2018-01-20
 */
public interface ITOrderService extends IService<TOrder> {

    List<Map<String, Object>> selectZtAuditeds(Pagination page,  String dotId, String name,String is_transfer,String mode);


    /**
     * 待出库
     *
     * @return
     * @date 2017年2月12日 下午9:14:34String receipt_status,
     @Param("receipt") String receipt, @Param("status") String status
     */
    List<Map<String, Object>> selectZtNoOut(Pagination page, String dotId,  String name, String is_out, String receipt_status,String receipt,String status,String mode);

    /**
     * 审核
     *
     * @return
     * @date 2017年2月12日 下午9:14:34
     */
    public boolean checkOrder(Integer id,Integer detp_id,String dotId,Integer user_id);

    List<Map<String,Object>> getFee(String deptid);

    List<Map<String,Object>> getOrderFee(String order_id);

    boolean opOrderFee(List<Map> maps,Integer detp_id,Integer user_id,String log_no,String order_id);

    boolean opOrderFeeSuper(List<Map> maps,Integer detp_id,Integer user_id,String log_no,String order_id);

    List<Map<String, Object>> selectTransfer(Pagination page,  String dotId,  String name,  String receipt_status,
                                              String receipt,  String status, String province_code, String city_code,String area_code);

    List<Map<String,Object>> getTransferOrders(List<Integer> ids);
    List<Map<String,Object>> selectDisOutList(Pagination page, List<Integer> ids);
    List<Map<String,Object>> selectZZOutList(Pagination page, List<Integer> ids);

    List<Map<String,Object>> selectDriverList(String dept_id);

    List<Map<String,Object>> selectReport(Pagination page,Map param);
    public List<Map<String, Object>> selectReportAvg(Map param);

    public boolean export(String filepath, String returnpath,List<Map<String, Object>> orders);

    Map<String,Object> indexNum(Map param);

    List<Map<String,Object>> selectOrders(String query,String dot_id);

    List<Map<String,Object>> selectSuperOrder(Pagination page,Map param);


    public boolean checkOrder(TOrder order,Integer detp_id,String dotId,Integer user_id);

    public boolean addAndTrian(String ids, TTrain tTrain,String cf,List<Map> fees);

    public boolean addAndTRTrian(TBill bill, String ids, TTrain tTrain, String cf, List<Map> fees, String mA, String mB, String mC, String mD, String mE,String mF,String xj,String transfer_name,String yj);

    /**
     * 回单列表查询订单列表
     * @param page
     * @param m
     * @return
     */
    List<Map<String,Object>> selectOrderList(Page<Map<String, Object>> page, Map m);

    /**
     * 自提
     * @param page
     * @param s
     * @param name
     * @param is_out
     * @param mRStatus
     * @param receipt
     * @param status
     * @param flag
     * @return
     */
    List<Map<String,Object>> selectSelfLiftInStoreHouse(Page<Map<String, Object>> page, String s, String name, String is_out, String mRStatus, String receipt, String status, String flag);

    /**
     * 根据id查询自提单信息
     */
    List<Map<String,Object>> selectSelfLiftDataList(Page<Map<String, Object>> page, List<Integer> ids);

    /**
     * 库存单重新入库
     * @param id
     */
    void revokeOrder(String id);

    /**
     *
     * @param id
     * @param tff
     * @param dshk
     * @param ldf
     * @param shf
     * @param byf
     * @param ccf
     */
    void addSubDelivery(Integer id, Double tff, Double dshk, Double ldf, Double shf, Double byf, Double ccf,String original_num);

    boolean exportOrderBack(String filepath, String returnpath, List<Map<String, Object>> orders);
}
